Skip to content

Bayesian fixes - #332

Merged
rozyczko merged 6 commits into
bayesianfrom
bayesian_fixes
Jul 15, 2026
Merged

Bayesian fixes#332
rozyczko merged 6 commits into
bayesianfrom
bayesian_fixes

Conversation

@rozyczko

Copy link
Copy Markdown
Member

This pull request introduces several improvements across the codebase, focusing on error handling, logging, and code robustness, particularly in the Bayesian analysis and experiment management logic. It also includes changes to the minimizer selection behavior and some minor API and naming cleanups. The most important changes are grouped below.

Bayesian Analysis Improvements

  • Added a helper method _set_bayesian_attr to handle invalid Bayesian hyper-parameter assignments gracefully, logging warnings and ensuring the UI remains consistent. Updated all Bayesian setter slots to use this helper.
  • Improved error handling in _on_sample_finished to log errors for empty or invalid results, ensuring that UI signals are always emitted even on failure.
  • Added a setter for the posterior property in bayesian.py to allow safe assignment of posterior results.
  • Changed the computation of finite R-hat diagnostics to use np.isfinite for more robust filtering.

Logging and Error Reporting

  • Replaced print statements with logger.warning or logger.exception in experiment and parameter management code, ensuring errors are consistently logged and easier to trace.

Minimizer and Experiment Selection Logic

  • Changed the default minimizer selection to the first classical minimizer (index 1), requiring explicit user choice for Bayesian minimization.
  • Added bounds checking in set_minimizer_current_index to prevent out-of-range minimizer selections.
  • Renamed collect_selected_experiments_datagroup to collect_all_experiments_datagroup and clarified that Bayesian sampling always runs over all experiments, not just selected ones.

API and Naming Cleanups

  • Fixed dictionary type annotations in home.py and updated the way version and release date are accessed from PYPROJECT.
  • Changed the property name in the mock status QML backend from phaseCount to modelsCount for clarity.

Miscellaneous

  • Removed unnecessary or problematic calls to setTerminationEnabled on threads, improving compatibility and stability.
  • Simplified the localFileToUrl helper to always use QUrl.fromLocalFile, removing special handling for Windows.
  • Commented out Windows-specific certificate setup and signing steps in the GitHub Actions workflow, likely to temporarily disable code signing on Windows CI builds.

@rozyczko
rozyczko merged commit 16e1b45 into bayesian Jul 15, 2026
16 checks passed
@rozyczko
rozyczko deleted the bayesian_fixes branch July 15, 2026 05:36
rozyczko added a commit that referenced this pull request Aug 3, 2026
* initial version.

* updates to the parameter passing

* nice Bayesian sub-tabs display

* add parameter names, add cancellation of sampling, add number of steps
in status bar

* correct parenting

* added required dependencies and modified Fit Status dialog

* add save button to the plots

* added tests for bayesian logic

* attempt at getting posterior median and credibility intervals on the
main chart

* enable/disable legends on bayesian sampling

* reload bumps images on recalculation. Use different caption when running
sampling

* updates and changes, new unit tests and GUI elements. New colors

* fixed typo

* actually sample multiple experiments

* nicer plots

* trace plot - nice display

* updated plots

* changes for the new EasyList based reflectometry-lib

* changes after updates to core

* unit test fixed

* weird conflict

* Bayesian fixes (#332)

* removed MD file, fixed #312

* fixed #313

* Fixed issues #312 - #322
Temporarily commented out code signing

* Addressed issues #323, #324, #325, #326

* addressed #327, #328, #329

* update paths in the Summary textboxes

* minor updates based on the new ERL

* summary results now show correct GoF #375

* reparent to released lib
rozyczko added a commit that referenced this pull request Aug 3, 2026
* summary prettified (#308)

* summary prettified

* minor fixes after code review

* make links clickable (#310)

* Bayesian analysis (#309)

* initial version.

* updates to the parameter passing

* nice Bayesian sub-tabs display

* add parameter names, add cancellation of sampling, add number of steps
in status bar

* correct parenting

* added required dependencies and modified Fit Status dialog

* add save button to the plots

* added tests for bayesian logic

* attempt at getting posterior median and credibility intervals on the
main chart

* enable/disable legends on bayesian sampling

* reload bumps images on recalculation. Use different caption when running
sampling

* updates and changes, new unit tests and GUI elements. New colors

* fixed typo

* actually sample multiple experiments

* nicer plots

* trace plot - nice display

* updated plots

* changes for the new EasyList based reflectometry-lib

* changes after updates to core

* unit test fixed

* weird conflict

* Bayesian fixes (#332)

* removed MD file, fixed #312

* fixed #313

* Fixed issues #312 - #322
Temporarily commented out code signing

* Addressed issues #323, #324, #325, #326

* addressed #327, #328, #329

* update paths in the Summary textboxes

* minor updates based on the new ERL

* summary results now show correct GoF #375

* reparent to released lib

* fixes from code review (#334)

* updated versioning (#335)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant